import request from '@/utils/request'

export function getAllDeviceInfo(pageNum) {
  return request({
    url: '/Turbine/all_turbine_info',
    method: 'GET',
    params: { pageNum }
  })
}

export function getAllWindFieldName() {
  return request({
    url: '/WindField/all_windfield_name',
    method: 'GET'
  })
}

export function getOneWindFieldTurbine(windFieldName,pageNum) {
  return request({
    url: '/WindField/all_turbine_info',
    method: 'GET',
    params:{ windFieldName,pageNum}
  })
}

export function addDevice(data) {
  return request({
    url: '/Turbine/add_turbine',
    method: 'POST',
    data
  })
}

export function deleteDevice(windFieldName,turbineId) {
  return request({
    url: '/Turbine/delete_turbine',
    method: 'POST',
    params: { windFieldName,turbineId }
  })
}

export function editDevice(data) {
  return request({
    url: '/Turbine/edit_turbine',
    method: 'POST',
    data
  })
}

export function getTurbineInfo(windFieldName,turbineId) {
  return request({
    url: '/Turbine/turbine_info',
    method: 'GET',
    params: { windFieldName,turbineId }
  })
}

export function getAllWindField(pageNum) {
  return request({
    url: '/WindField/all_windfield_info',
    method: 'GET',
    params: { pageNum }
  })
}
export function addWindField(data) {
  return request({
    url: '/WindField/add_windfield',
    method: 'POST',
    data
  })
}

export function deleteWindField(windFieldName,turbineId) {
  return request({
    url: '/WindField/delete_windfield',
    method: 'POST',
    params: { windFieldName,turbineId }
  })
}

export function editWindField(data) {
  return request({
    url: '/WindField/edit_windfield',
    method: 'POST',
    data
  })
}

export function getWindFieldInfo(windFieldName) {
  return request({
    url: '/WindField/windfield_info',
    method: 'GET',
    params: { windFieldName }
  })
}

